package jee.boot.module.mail.interceptor;

import jee.boot.entity.mail.Mail;
import jee.boot.module.mail.service.SysMailService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 默认的邮件发送后置处理
 * 
 * @author zhilei.wang
 *
 */
@Component
public class DefaultMailPostInterceptor implements MailInterceptor {
	private Log log = LogFactory.getLog(DefaultMailPostInterceptor.class);
	@Autowired
	private SysMailService service;
	@Override
	public void process(Mail mail) throws Exception {
		// 邮件发送后,本地保存记录
		service.save(mail);
	}
}
